Optimal. Leaf size=129 \[ -\frac{a^3 (B+i A) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}-\frac{4 i a^3 B}{c^3 f (\tan (e+f x)+i)}-\frac{2 a^3 B}{c^3 f (\tan (e+f x)+i)^2}+\frac{a^3 B \log (\cos (e+f x))}{c^3 f}+\frac{i a^3 B x}{c^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.153866, antiderivative size = 129, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.073, Rules used = {3588, 78, 43} \[ -\frac{a^3 (B+i A) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}-\frac{4 i a^3 B}{c^3 f (\tan (e+f x)+i)}-\frac{2 a^3 B}{c^3 f (\tan (e+f x)+i)^2}+\frac{a^3 B \log (\cos (e+f x))}{c^3 f}+\frac{i a^3 B x}{c^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3588
Rule 78
Rule 43
Rubi steps
\begin{align*} \int \frac{(a+i a \tan (e+f x))^3 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^3} \, dx &=\frac{(a c) \operatorname{Subst}\left (\int \frac{(a+i a x)^2 (A+B x)}{(c-i c x)^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{a^3 (i A+B) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}+\frac{(i a B) \operatorname{Subst}\left (\int \frac{(a+i a x)^2}{(c-i c x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{a^3 (i A+B) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}+\frac{(i a B) \operatorname{Subst}\left (\int \left (-\frac{4 i a^2}{c^3 (i+x)^3}+\frac{4 a^2}{c^3 (i+x)^2}+\frac{i a^2}{c^3 (i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{i a^3 B x}{c^3}+\frac{a^3 B \log (\cos (e+f x))}{c^3 f}-\frac{a^3 (i A+B) (1+i \tan (e+f x))^3}{6 c^3 f (1-i \tan (e+f x))^3}-\frac{2 a^3 B}{c^3 f (i+\tan (e+f x))^2}-\frac{4 i a^3 B}{c^3 f (i+\tan (e+f x))}\\ \end{align*}
Mathematica [A] time = 4.28417, size = 167, normalized size = 1.29 \[ \frac{a^3 (\cos (3 (e+2 f x))+i \sin (3 (e+2 f x))) \left (\cos (3 (e+f x)) \left (-i A+3 B \log \left (\cos ^2(e+f x)\right )+6 i B f x-B\right )+A \sin (3 (e+f x))+9 i B \sin (e+f x)-i B \sin (3 (e+f x))+6 B f x \sin (3 (e+f x))-3 B \cos (e+f x)-3 i B \sin (3 (e+f x)) \log \left (\cos ^2(e+f x)\right )\right )}{6 c^3 f (\cos (f x)+i \sin (f x))^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.052, size = 164, normalized size = 1.3 \begin{align*}{\frac{{\frac{4\,i}{3}}{a}^{3}B}{f{c}^{3} \left ( \tan \left ( fx+e \right ) +i \right ) ^{3}}}-{\frac{4\,A{a}^{3}}{3\,f{c}^{3} \left ( \tan \left ( fx+e \right ) +i \right ) ^{3}}}-{\frac{5\,iB{a}^{3}}{f{c}^{3} \left ( \tan \left ( fx+e \right ) +i \right ) }}+{\frac{A{a}^{3}}{f{c}^{3} \left ( \tan \left ( fx+e \right ) +i \right ) }}-{\frac{B{a}^{3}\ln \left ( \tan \left ( fx+e \right ) +i \right ) }{f{c}^{3}}}-{\frac{2\,i{a}^{3}A}{f{c}^{3} \left ( \tan \left ( fx+e \right ) +i \right ) ^{2}}}-4\,{\frac{B{a}^{3}}{f{c}^{3} \left ( \tan \left ( fx+e \right ) +i \right ) ^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.454, size = 201, normalized size = 1.56 \begin{align*} \frac{{\left (-i \, A - B\right )} a^{3} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, B a^{3} e^{\left (4 i \, f x + 4 i \, e\right )} - 6 \, B a^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 6 \, B a^{3} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{6 \, c^{3} f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 2.66081, size = 214, normalized size = 1.66 \begin{align*} \frac{B a^{3} \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{c^{3} f} + \begin{cases} \frac{6 B a^{3} c^{6} f^{2} e^{4 i e} e^{4 i f x} - 12 B a^{3} c^{6} f^{2} e^{2 i e} e^{2 i f x} + \left (- 2 i A a^{3} c^{6} f^{2} e^{6 i e} - 2 B a^{3} c^{6} f^{2} e^{6 i e}\right ) e^{6 i f x}}{12 c^{9} f^{3}} & \text{for}\: 12 c^{9} f^{3} \neq 0 \\\frac{x \left (A a^{3} e^{6 i e} - i B a^{3} e^{6 i e} + 2 i B a^{3} e^{4 i e} - 2 i B a^{3} e^{2 i e}\right )}{c^{3}} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.63729, size = 348, normalized size = 2.7 \begin{align*} -\frac{\frac{60 \, B a^{3} \log \left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + i\right )}{c^{3}} - \frac{30 \, B a^{3} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{c^{3}} - \frac{30 \, B a^{3} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{c^{3}} - \frac{147 \, B a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{6} - 60 \, A a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} + 942 i \, B a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} - 2445 \, B a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} + 200 \, A a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 3620 i \, B a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 2445 \, B a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 60 \, A a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 942 i \, B a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 147 \, B a^{3}}{c^{3}{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + i\right )}^{6}}}{30 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]